-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Kconfig: Fix FLASH_LOAD_{OFFSET,SIZE} issue when enabling BOOTLOADER_MCUBOOT in menuconfig + documentation and naming improvements #20740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kconfig: Fix FLASH_LOAD_{OFFSET,SIZE} issue when enabling BOOTLOADER_MCUBOOT in menuconfig + documentation and naming improvements #20740
Conversation
Having FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE always configurable froze their values at 0 when BOOTLOADER_MCUBOOT was enabled in menuconfig, when instead the values from /chosen/zephyr,code-partition in devicetree should be used. BOOTLOADER_MCUBOOT selects USE_CODE_PARTITION, which is a flag to use the devicetree information. To fix it, only make FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE configurable when USE_CODE_PARTITION is disabled. It looks like no configuration files set them at the moment. See the added documentation in zephyrproject-rtos#20722 for an explanation of why this happens. This bit novalisek in zephyrproject-rtos#20673. Fixes: zephyrproject-rtos#20673 Signed-off-by: Ulf Magnusson <[email protected]>
The prompt and help string for USE_CODE_PARTITION were too terse and didn't make it clear that it's related to devicetree, which confused me. Spell things out in more detail. Unless the meaning of a symbol is completely obvious from context, aim for at least a few sentences of help text. Think about what would be confusing for someone coming at it without much context. Signed-off-by: Ulf Magnusson <[email protected]>
USE_CODE_PARTITION is a bit vague as a symbol name ("use code partition
how?"). Rename it to USE_DT_CODE_PARTITION to make it clearer that it's
about devicetree.
This would break any third-party configuration files that set it, but
it'll generate an error since kconfig.py promotes warnings to errors, so
it's probably not a big deal.
Signed-off-by: Ulf Magnusson <[email protected]>
Use a top-level 'if' instead of three separate 'depends on'. They're exactly equivalent (top-level 'if's are just a shorthand for adding 'depends on' to each item within the 'if'). Signed-off-by: Ulf Magnusson <[email protected]>
nvlsianpu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look fine.
For future; Would be great if PR description was an abstract instead of commit messages conglomerate :D
ioannisg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
mbolivar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
see my comment at #20673 (comment) I think it is not working properly when enabling and disabling mcuboot again |
|
Anyone outside Nordic would like to review this? @galak @MaureenHelm |
Posted a comment there that explains it. |
|
Hi, I stumbled on this PR and issue #20673 . I had been struggling to get the code-partition setting in devicetree to actually relocate my code. I had to manually include in my proj.conf to locate my code past my boot loader (uf2-samd). Then I found this issue searching "code-partition". Turns out, adding works. So I added that to my board's defconfig. The documentation about code-partition I referred to is here: https://github.com/zephyrproject-rtos/zephyr/blob/master/doc/guides/dts/flash_partitions.inc. I think it would be helpful if this page was updated to explain that CONFIG_USE_CODE_PARTITION needs to be set so that the code-partition devicetree setting is used. |
|
Moving this to 2.2, to get reviews outside nordic |
Fixes: #20673
Main fix:
Documentation improvements and cleanups: